<template>
  <div class="tile">
    <article class="tile is-child box tx-left">
    <div class="title">
    <h1 class="title-text title-left">{{title}}</h1>
     <div class="title-right btn-right" v-if="$slots.button || button">
          <slot name="button">{{ button }}</slot>
     </div>
    </div>
    <div class="tile-content">
     <slot></slot>
    </div>
    </article>
  </div>
</template>

<script>
export default {
  name: 'Tile',
  props: {
    title: {
      type: String,
      default: ''
    },
    button: {
      type: String,
      default: ''
    }
  },
  data () {
    return {
    }
  }
}
</script>

<style>
.tile.is-parent {
    padding: .75rem;
}
.tile {
    -ms-flex-align: stretch;
    align-items: stretch;
    display: block;
    -ms-flex-preferred-size: 0;
    flex-basis: 0;
    -ms-flex-positive: 1;
    flex-grow: 1;
    -ms-flex-negative: 1;
    flex-shrink: 1;
    min-height: -webkit-min-content;
    min-height: -moz-min-content;
    min-height: min-content;
}
.tile.is-child {
    margin: 0!important;
}
.box {
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 3px hsla(0,0%,4%,.1), 0 0 0 1px hsla(0,0%,4%,.1);
    display: block;
    padding: 1.25rem;
}
.title {
    line-height: 1.125;
    margin:0px 0px 1.5rem 0px;
    display: flex;
}
.tx-left{
    text-align:left;
}
.title-left, .title-right {
    -ms-flex-align: stretch;
    -webkit-box-align: stretch;
    align-items: stretch;
    -ms-flex-preferred-size: 0;
    flex-basis: 0;
    -ms-flex-positive: 1;
    -webkit-box-flex: 1;
    flex-grow: 1;
    -ms-flex-negative: 0;
    flex-shrink: 0;
}
.btn-right .el-button{
    float:right;
}
.title-text{
    color: #363636;
    font-size: 2rem;
    font-weight: 300;
    line-height: 1.125;
    margin:0px;
}
.btn-right .el-button{
    margin-left:5px;
}
.tile-content{
    display: flex;
}

</style>
